import {View} from '@tarojs/components'

const IsReadCircle: React.FC<{isRead: IsRead}> = ({isRead}): JSX.Element => {
  return (
    <View
      className={`w-8 h-8 rounded-full ${
        isRead === 0 ? 'bg-info' : 'bg-success'
      }`}
    ></View>
  )
}

const IsRead: React.FC<{isRead?: IsRead}> = ({isRead}): JSX.Element => {
  return isRead !== undefined ? (
    <IsReadCircle isRead={isRead}></IsReadCircle>
  ) : (
    <View></View>
  )
}

export default IsRead
